package view.microgui
{
	import flash.display.Sprite;
	import view.micro.FieldUnitSprite;
	import view.micro.IMicroSprite;
	
	/**
	 */
	public class AttackSelectorIcon extends Sprite implements IMicroSprite
	{
		public var unit_sprite:FieldUnitSprite;
		public var radius:int;
		
		public function AttackSelectorIcon(unit_sprite:FieldUnitSprite)
		{
			this.unit_sprite = unit_sprite;
			update();
		}
		
		public function update():void
		{
			var r:int = unit_sprite.unit.numberSoldiers / 10;
			if (r != radius)
			{
				radius = r;
				graphics.clear();
				graphics.beginFill(0x444444, 0.5);
				graphics.drawCircle(0, 0, radius);
				graphics.endFill();
			}
			
			x = unit_sprite.x;
		}
		
		public function readyToRemove():Boolean
		{
			return unit_sprite.readyToRemove();
		}
	}
}